<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
const goHome = () => {
  router.push('/')
}
</script>
<script>
export default {
  name: '404Page'
}
</script>
<template>
  <div class="not-found-container">
    <div class="not-found-img">
      <img src="@/assets/404_images/404.png" alt="404" />
    </div>
    <div class="not-found-info">
      <h1>404 - 页面未找到</h1>
      <p>抱歉，您访问的页面不存在或已被删除。</p>
      <ul>
        <li>请检查您输入的网址是否正确</li>
        <li>您可以返回主页，或联系管理员获取帮助</li>
      </ul>
      <el-button type="primary" @click="goHome">返回主页</el-button>
    </div>
  </div>
</template>

<style scoped lang="scss">
.not-found-container {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f8fa;
  padding: 0;
  margin: 0;

  .not-found-img,
  .not-found-info {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    height: 60vh;
    margin: 32px 0;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  }

  .not-found-img {
    border-radius: 12px 0 0 12px;
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    img {
      width: 320px;
      max-width: 90%;
      height: auto;
      object-fit: contain;
      background: #fff;
      border-radius: 12px 0 0 12px;
      box-shadow: none;
      padding: 0;
      display: block;
    }
  }

  .not-found-info {
    border-radius: 0 12px 12px 0;
    padding: 0 32px;
    box-shadow: none;
    h1 {
      font-size: 2.2rem;
      color: #409eff;
      margin-bottom: 18px;
      font-weight: bold;
    }
    p {
      font-size: 1.1rem;
      color: #666;
      margin-bottom: 18px;
    }
    ul {
      color: #999;
      margin-bottom: 28px;
      padding-left: 18px;
      li {
        margin-bottom: 6px;
        font-size: 0.98rem;
      }
    }
    .el-button {
      font-size: 1rem;
      padding: 10px 32px;
      border-radius: 6px;
    }
  }

  @media (max-width: 900px) {
    flex-direction: column;
    .not-found-img,
    .not-found-info {
      width: 90vw;
      min-width: unset;
      height: auto;
      margin: 16px 0;
      border-radius: 12px;
      box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    }
    .not-found-img {
      border-radius: 12px 12px 0 0;
      img {
        border-radius: 12px 12px 0 0;
      }
    }
    .not-found-info {
      border-radius: 0 0 12px 12px;
      padding: 24px 8px;
    }
  }
}
</style>